package com.source.multithread.threadd;


import sun.management.snmp.jvminstr.JvmThreadInstanceEntryImpl;

/**
 * @Author wengqy
 * @Date 2020/12/25
 */
public class ThreadDemo2 {
    public static void main(String[] args) {
        Pear pear  = new Pear();
        pear.setName("CK");
        pear.start();
        System.out.println(Thread.currentThread().getName()+"--------MAIN"); // main--------MAIN
    }
}


class Pear extends Thread {
    @Override
    public void run() {
        System.out.println("sub....");  //
        System.out.println(Thread.currentThread());  // Thread[CK,5,main]
        System.out.println(this.getName()); // CK
        System.out.println(Thread.currentThread().getName()); //CK
        System.out.println(Thread.currentThread().equals(this));  //true
        System.out.println(Thread.currentThread() == this);  //true
    }
}